package ssssscala.loadsandsave

import org.apache.spark.sql.SQLContext
import org.apache.spark.{SparkConf, SparkContext}

/**
  * Auther: Mengkunxuan
  * Date:2018 /9/2616:18
  * Description:
  */
object MenuallySpecifyOptions {
  def main(args: Array[String]): Unit = {
      val conf = new SparkConf().setAppName("ManuallySpecifyOptions").setMaster("local")
      val sc = new SparkContext(conf)
      val sqlContext = new SQLContext(sc)
      val peopleDF = sqlContext.read.format("json").load("c:/people.json")
      peopleDF.select("name").write.format("parquet").save("c:/")
  }
}
